package com.sbx.entity.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sbx.validations.RequiredField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("user_app")
public class UserApp {


    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty("用户appid")
    private String id;


    @ApiModelProperty("用户id")
    @NotEmpty(message = "用户id不能为空", groups = RequiredField.class)
    private String userId;


    @ApiModelProperty("app id")
    @NotEmpty(message = "app id 不能为空", groups = RequiredField.class)
    private String appId;


    @ApiModelProperty(value = "添加时间", example = "2023-02-08 21:44:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date created;


}
